<html>
<head><meta charset="utf-8"><title>pass literals to other macros · t-lang · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/index.html">t-lang</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/pass.20literals.20to.20other.20macros.html">pass literals to other macros</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="197950091"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/213817-t-lang/topic/pass%20literals%20to%20other%20macros/near/197950091" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Roland Kuhn <a href="https://rust-lang.github.io/zulip_archive/stream/213817-t-lang/topic/pass.20literals.20to.20other.20macros.html#197950091">(May 18 2020 at 15:20)</a>:</h4>
<p>Not sure whether this is the right place to ask: when expanding a declarative macro to include a proc macro invocation, literals are hidden behind an opaque token — the only way to inspect a matched literal is to match it with TokenTree type. This is quite restricting because it means that the proc macro needs to handle all the cases if I want to treat literals differently. What is the reason for this restriction?</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>